package cn.btks.backstagemanage.bu.repository;

import cn.btks.backstagemanage.bu.pojo.BuZxbzml;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @Author lijun
 * @Date 2021/1/7 11:21
 */
@Repository
public interface ZxbzmlRepository extends JpaRepository<BuZxbzml, Long>, JpaSpecificationExecutor<BuZxbzml> {

    @Query(value = "SELECT * FROM bu_zxbzml WHERE " +
            "hy LIKE CONCAT('%', ?1, '%') OR " +
            "name LIKE CONCAT('%', ?1, '%') OR " +
            "glmllb LIKE CONCAT('%', ?1, '%')",
            nativeQuery = true)
    List<BuZxbzml> zxbzmlList(String keyWord);
}
